﻿using GameView.Comment;
using GameView.Models;
using IPPMS.Application.Dtos.CommandRecordDto;
using IPPMS.Application.Dtos.Recharge;

namespace GameView.Services
{
    public class CommandRecordService
    {
        public async Task<ApiResponse<PagedList<CommandRecordOutPutDto>>> GetByPage(CommandRecordQueryDto queryDto)
        {
            var res = await $"{APIHelper.CommandRecord}/by-page".PostAsync<PagedList<CommandRecordOutPutDto>, CommandRecordQueryDto>(queryDto);
            return res;
        }

        public async Task<ApiResponse<int>> BatchDelete(List<int> ids)
        {
            var res = await $"{APIHelper.CommandRecord}/batch-delete".DeleteData<List<int>>(ids);
            return res;
        }

        public async Task<ApiResponse<CommandRecordOutPutDto>> Add(CommandRecordAddDto queryDto)
        {
            var res = await $"{APIHelper.CommandRecord}".AddNewAsync<CommandRecordAddDto, CommandRecordOutPutDto>(queryDto);
            return res;
        }
    }
}